<?php
        global $Room;
        $id=$connection->user['room'];
        $card=$Room[$id]['user'][$connection->user['id']]->user['card'];
		unset($card[3]);
		unset($card[4]);
		$Room[$id]['user'][$connection->user['id']]->user['card']=$card;
		
        $Room[$id]['user'][$connection->user['id']]->user['tpzt']='1';
        $sfniu=niuniu($card);
        $msg2=array();
        if(!$sfniu && 1==2){
            $niu=0;
            $msg['card']=$card;
            $msg2['card']=$card;
            $Room[$id]['user'][$connection->user['id']]->user['sfniu']=0;
            act('tanpaixx2',$msg,$connection);
        } else {
            $niu=niu($card);
            $msg['card']=$card;
            $msg2['card']=$card;
            $Room[$id]['user'][$connection->user['id']]->user['card']=$card;
            $Room[$id]['user'][$connection->user['id']]->user['sfniu']=1;
            act('tanpaixx',$msg,$connection);
        }


        $mp3='point'.$niu;        
        $Room[$id]['user'][$connection->user['id']]->user['niu']=$niu;  
        $msg2['user']=$connection->user;

        $msg=array();
        $msg['id']='operationButton';
        $msg['html']='';
        act('html',$msg,$connection);

        $img='/app/img/point'.$niu.'.png';
        $msg=array();
        $msg['index']=$connection->user['index'];
        $msg['img']=$img;

        $tpsl=0;
        $zbsl=0;
        foreach ($Room[$id]['user'] as $connection3) {

            if($connection3->user['zt']=='1'){
                $zbsl=$zbsl+1;
            }
            if($connection3->user['tpzt']!='-1' && $connection3->user['zt']=='1'){
                $tpsl=$tpsl+1;
            }

            if($connection3->user['online']!='-1'){
                act('showmemberBull',$msg,$connection3);
                act('mp3play',$mp3,$connection3);
                if($connection3->user['id']!=$connection->user['id']){
                        act('tanpaixxother',$msg2,$connection3);
                }
            }
        }

        if($zbsl==$tpsl &&  $Room[$id]['xx']['zt']=='5' && $data2['wczt']!=1){
           $Room[$id]['xx']['zt']=='6';
            $data=array();
            $data['act']='setfanpai';
            $data['room']=$id;
            reqact($data,'');
        }


